package com.webank.webase.chain.mgr.repository.bean;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@NoArgsConstructor
@EqualsAndHashCode
public class TbGroup implements Serializable {

    public TbGroup(BigInteger timestamp, Integer groupId, Integer chainId, String groupName, Integer nodeCount, String description, Integer groupType) {
        this.groupId = groupId;
        this.chainId = chainId;
        this.groupName = groupName;
        this.nodeCount = nodeCount;
        this.description = description;
        this.groupType = groupType.byteValue();
        this.groupTimestamp = String.valueOf(timestamp);
        Date now = new Date();
        this.createTime = now;
        this.modifyTime = now;
    }

    public TbGroup(Integer groupId, Integer chainId, String groupName, Integer nodeCount, String description, Integer groupType) {
        this.groupId = groupId;
        this.chainId = chainId;
        this.groupName = groupName;
        this.nodeCount = nodeCount;
        this.description = description;
        this.groupType = groupType.byteValue();
        Date now = new Date();
        this.createTime = now;
        this.modifyTime = now;
    }

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.group_id
     *
     * @mbg.generated
     */
    private Integer groupId;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.chain_id
     *
     * @mbg.generated
     */
    private Integer chainId;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.group_name
     *
     * @mbg.generated
     */
    private String groupName;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.group_status
     *
     * @mbg.generated
     */
    private Byte groupStatus;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.node_count
     *
     * @mbg.generated
     */
    private Integer nodeCount;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.description
     *
     * @mbg.generated
     */
    private String description;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.group_type
     *
     * @mbg.generated
     */
    private Byte groupType;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.create_time
     *
     * @mbg.generated
     */
    private Date createTime;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.modify_time
     *
     * @mbg.generated
     */
    private Date modifyTime;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.group_timestamp
     *
     * @mbg.generated
     */
    private String groupTimestamp;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.epoch_sealer_num
     *
     * @mbg.generated
     */
    private Integer epochSealerNum;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_group.node_id_list
     *
     * @mbg.generated
     */
    private String nodeIdList;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table tb_group
     *
     * @mbg.generated
     */
    private static final long serialVersionUID = 1L;
}
